package net.maergaiyun.service;

import net.maergaiyun.controller.request.ConfirmOrderRequest;
import net.maergaiyun.controller.request.ProductOrderPageRequest;
import net.maergaiyun.enums.ProductOrderPayTypeEnum;
import net.maergaiyun.model.EventMessage;
import net.maergaiyun.util.JsonData;

import java.util.Map;

public interface ProductOrderService {

    /**
     * 分页
     *
     * @param request
     * @return
     */
    Map<String, Object> page(ProductOrderPageRequest request);

    /**
     * 查询订单状态
     *
     * @param outTradeNo
     * @return
     */
    String queryProductOrderState(String outTradeNo);

    JsonData confirmOrder(ConfirmOrderRequest request);

    /**
     * 关单
     *
     * @param eventMessage
     * @return
     */
    Boolean closeProductOrder(EventMessage eventMessage);

    /**
     * 处理支付回调通知
     *
     * @param productOrderPayTypeEnum
     * @param paramsMap
     * @return
     */
    JsonData processOrderCallBackMsg(ProductOrderPayTypeEnum productOrderPayTypeEnum, Map<String, String> paramsMap);

    /**
     * 处理订单队列相关消息
     *
     * @param eventMessage
     */
    void handleProductOrderMessage(EventMessage eventMessage);
}
